package cn.stylefeng.guns.modular.wx.mp.builder;

import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;

/**
 * 红包消息
 * 
 * @author Binary Wang(https://github.com/binarywang)
 */
public class HBMsgBuilder extends AbstractBuilder {

    @Override
    public WxMpXmlOutMessage build(String url, WxMpXmlMessage wxMessage,
                                   WxMpService service) {

     WxMpXmlOutNewsMessage.Item article = new WxMpXmlOutNewsMessage.Item();
	  
	  article.setUrl(url);
	  article.setPicUrl("http://www.dogroot.com/wxConsole/assets/imgs/hongbao.jpg");    //封面图片
	 // article.setDescription("打开红包");
	  article.setTitle("点击领取红包");
          
      WxMpXmlOutNewsMessage m = WxMpXmlOutMessage.NEWS()
    	.toUser(wxMessage.getFromUser())
    	.fromUser(wxMessage.getToUser())
    	.addArticle(article)
    	.build();
    	
//        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.IMAGE().mediaId(content)
//            .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
//            .build();

        return m;
    }

}
